package com.jie.commonlib.base

import androidx.appcompat.app.AppCompatActivity
import com.jie.commonlib.network.http.HttpHelper

/**
 * Activity基类
 * @author jie
 */
abstract class BaseActivity : AppCompatActivity() {
    /**
     * 网络请求标识
     */
    @JvmField
    val mHttpTag = this.toString()

    override fun onDestroy() {
        super.onDestroy()
        // 取消网络请求
        HttpHelper.cancel(mHttpTag)
    }

    /**
     * 点击toolbar的返回按钮，支持返回
     */
    override fun onSupportNavigateUp(): Boolean {
        onBackPressedDispatcher.onBackPressed()
        return super.onSupportNavigateUp()
    }
}